﻿using System;
using System.Linq;
using System.IO;
using System.IO.IsolatedStorage;
using System.Collections.Generic;
using Microsoft.LightSwitch;
using Microsoft.LightSwitch.Framework.Client;
using Microsoft.LightSwitch.Presentation;
using Microsoft.LightSwitch.Presentation.Extensions;
namespace LightSwitchApplication
{

    public partial class Application
    {
        partial void SearchFilteredCustomers_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanSearchCustomer);
        }

        partial void EditableCustomers_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanEditCustomer);
        }

        partial void EditableAddresses_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CenEditAddress);
        }

        partial void EditableCompetitors_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanEditCompetitor);
        }

        partial void EditableContacts_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanEditContact);
        }

        partial void EditableProductGroups_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanEditProduct);
        }

        partial void EditableProductPrices_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanEditPrice);
        }

        partial void EditableSalesOrders_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanEditSalesOrder);
        }

        partial void EditableSalesPersons_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanEditSalesPerson);
        }

        partial void EditableShops_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanEditShop);
        }

        partial void EditableUnits_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.SecurityAdministration);
        }

        partial void VisitTypesListDetail_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanEditVisitTypeGoal);
        }

        partial void SearchFilteredVisits_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanSearchVisit);
        }

        partial void CreateNewCustomer_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanEditCustomer);
        }

        partial void EditableGeography_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanEditGeography);
        }

        partial void QuestionerGroupsListDetail_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanEditQuestioner);
        }

        partial void EditableSystemParameters_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.SecurityAdministration);
        }

        partial void EditableSystemEvents_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.SecurityAdministration);
        }

        partial void SearchFilteredCompetitors_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanSearchShop);
        }

        partial void EditableVisits_CanRun(ref bool result, int? SalesPersonId, int? CustomerId)
        {
            result = this.User.HasPermission(Permissions.CanEditVisit);
        }

        partial void SearchFilteredContacts_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanSearchContact);
        }

        partial void SearchFilteredSalesOrders_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanSearchSalesOrder);
        }

        partial void SearchFilteredShops_CanRun(ref bool result)
        {
            result = this.User.HasPermission(Permissions.CanSearchShop);
        }

    }
}
